package android_dhbw.gpx;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;


public class TabsActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        
        setContentView(R.layout.main);
        
        TabHost tabHost = getTabHost();
        
        // Tab for Overview.
        TabSpec overviewspec = tabHost.newTabSpec(getString(R.string.overview_title));
        // setting Title and Icon for the Tab
        overviewspec.setIndicator(getString(R.string.overview_title), getResources().getDrawable(R.drawable.icon_overview_tab));
        Intent overviewIntent = new Intent(this, OverviewActivity.class);
        overviewspec.setContent(overviewIntent);
 
        // Tab for GoogleMaps
        TabSpec mapspec = tabHost.newTabSpec(getString(R.string.map_title));
        mapspec.setIndicator(getString(R.string.map_title), getResources().getDrawable(R.drawable.icon_map_tab));
        Intent mapIntent = new Intent(this, TrackOnMapActivity.class);
        mapspec.setContent(mapIntent);
 
        // Tab for Elevation Profile
        TabSpec elevationSpec = tabHost.newTabSpec(getString(R.string.elevation_title));
        elevationSpec.setIndicator(getString(R.string.elevation_title), getResources().getDrawable(R.drawable.icon_elevation_tab));
        Intent elevationIntent = new Intent(this, ElevationActivity.class);
        elevationSpec.setContent(elevationIntent);
 
        // Adding all TabSpec to TabHost
        tabHost.addTab(overviewspec); 
        tabHost.addTab(mapspec); 
        tabHost.addTab(elevationSpec);
        
    }
}